//
//  KDEveryOrWeekModel.m
//  WangJingApp
//
//  Created by 魏强 on 17/2/20.
//  Copyright © 2017年 KDTech. All rights reserved.
//

#import "KDEveryOrWeekModel.h"

@implementation KDEveryOrWeekModel
- (void)setSelfSubmission:(BOOL)selfSubmission{
    _selfSubmission = selfSubmission;
    if (selfSubmission) {
        //如果是本单位报送，那就相加
        self.allSubmission = [NSString stringWithFormat:@"%ld",self.subordinateSubmission + self.unitSubmission];
        self.allAccept = [NSString stringWithFormat:@"%ld", self.subordinateAccepted +self.infoAccepted];
        
    }else{
        self.allSubmission = [NSString stringWithFormat:@"%ld", self.subordinateAccepted] ;
        self.allAccept = [NSString stringWithFormat:@"%ld", self.subordinateAccepted];
    }
    if (self.allSubmission.floatValue) {
        //按理说self.allAccept应该要小于self.allSubmission的
        self.acceptPercent = (self.allAccept.intValue /self.allSubmission.floatValue) * 100;
        if (self.acceptPercent > 100) {
            self.acceptPercent = 100;
        }
    }else{
        self.acceptPercent = 0;
    }
    
    
}
@end
